<?php
namespace app\beautiful\model;
use app\common\model\CommonModel;

class LookModel extends CommonModel{
    protected  $name = 'beautiful_look';
    protected  $pk   = 'look_id';
    protected  $type = [
        'goods_ids'=>'array',
        'photos'=>'array'
    ];

   

    public function likes()
    {
        return $this->hasMany(LookLikesModel::class,'look_id','look_id');
    }

    public function getUpdateTimeFormatAttr($value,$data)
    {

        return $data['update_time'] > 0 ? date('Y-m-d H:i:s',$data['update_time']) : '-';
    }
}
